<?php
require_once('../class/config.php');

$hello = new Client_ES1_hello('blaa');
$areaId = '13';
$date = date('Y-m-d');
$facilityId = '13';
$NOId = 'T2NO2';
$supplyTerminationMessage = new Client_ES1_supplyTerminationMessage($areaId, $date, $facilityId, $NOId);
$sendSupplyTerminationMessage = new Client_ES1_SendSupplyTerminationMessage($supplyTerminationMessage);

$meterValue = '77';
$meteringMessage = new Client_ES1_meteringMessage($areaId, $date, $facilityId, $meterValue, $NOId);
$sendMeteringReadings = new Client_ES1_SendMeteringReadings($meteringMessage);

print_r($sendSupplyTerminationMessage);
print_r(serialize($sendSupplyTerminationMessage));
exit();


$accepted = true;
$areaId = 12;
$facilityId = 10;
$NOId = SERVICE_NO_ID;
$supplierChangeReplyMessage = new Client_ES1_supplierChangeReplyMessage($accepted, $areaId, $facilityId, $NOId);
$supplierChangeReplay = new Client_ES1_SupplierChangeReply($supplierChangeReplyMessage);

/*
$soapClient = new Client_ES1_ElectricitySupplier();
//var_dump($soapClient->__getFunctions());

try {
    //print_r($soapClient->hello($hello));
    print_r($soapClient->SendSupplyTerminationMessage($sendSupplyTerminationMessage));
    print_r($soapClient->SendMeteringReadings($sendMeteringReadings));
} catch (SoapFault $exception) {
    print_r($exception);
}
*/

$client = new Client_ES1();
/*
echo $client->sendMeterReading($sendMeteringReadings) ? 'OK' : 'NOT';
print_r($client->result);
*/

echo $client->sendSupplyTermination($sendSupplyTerminationMessage) ? 'OK' : 'NOT';
print_r($client->result);

/*
echo $client->sendSupplierChangeReplay($supplierChangeReplay) ? 'OK' : 'NOT';
print_r($client->result);
*/